home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / lib / H / access / sdir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1.4 KB  |  59 lines

  1. /*
  2.  * sdir.h --
  3.  *    POSTGRES scan direction definitions.
  4.  *
  5.  * Identification:
  6.  *    $Header: /private/postgres/src/lib/H/access/RCS/sdir.h,v 1.6 1991/04/28 09:15:57 cimarron Exp $
  7.  */
  8.  
  9. #ifndef    SDirIncluded    /* Include this file only once. */
  10. #define SDirIncluded    1
  11.  
  12. #include "tmp/c.h"
  13.  
  14. typedef int8    ScanDirection;
  15.  
  16. #define BackwardScanDirection    (-1)
  17. #define NoMovementScanDirection    0
  18. #define ForwardScanDirection    1
  19.  
  20. /*
  21.  * ScanDirectionIsValid --
  22.  *    True iff scan direciton is valid.
  23.  */
  24. #define ScanDirectionIsValid(direction) \
  25.     ((bool) (AsInt8(BackwardScanDirection) <= AsInt8(direction) && \
  26.          AsInt8(direction) <= AsInt8(ForwardScanDirection)))
  27.  
  28. /*
  29.  * ScanDirectionIsBackward --
  30.  *    True iff scan direciton is backward.
  31.  *
  32.  * Note:
  33.  *    Assumes scan direction is valid.
  34.  */
  35. #define ScanDirectionIsBackward(direction) \
  36.     ((bool) (AsInt8(direction) == AsInt8(BackwardScanDirection)))
  37.  
  38. /*
  39.  * ScanDirectionIsNoMovement --
  40.  *    True iff scan direciton indicates no movement.
  41.  *
  42.  * Note:
  43.  *    Assumes scan direction is valid.
  44.  */
  45. #define ScanDirectionIsNoMovement(direction) \
  46.     ((bool) (AsInt8(direction) == AsInt8(NoMovementScanDirection)))
  47.  
  48. /*
  49.  * ScanDirectionIsForward --
  50.  *    True iff scan direciton is forward.
  51.  *
  52.  * Note:
  53.  *    Assumes scan direction is valid.
  54.  */
  55. #define ScanDirectionIsForward(direction) \
  56.     ((bool) (AsInt8(direction) == AsInt8(ForwardScanDirection)))
  57.  
  58. #endif    /* !defined(SDirIncluded) */
  59.